home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / ROXY / ROXY.dxr / 00174.ls < prev    next >
Encoding:
Text File  |  1996-10-18  |  2.9 KB  |  73 lines

  1. on enterFrame
  2.   REPORT2("enterFrame(frame " & the frame & "):OK, the ROXY movie has loaded... (at " & the timer & " ticks)")
  3.   if the machineType <> 256 then
  4.     closeResFile()
  5.     openResFile(the pathName & "ROXY cursors")
  6.   end if
  7. end
  8.  
  9. on exitFrame
  10.   global oStoryteller, oPuppeteer, builderWindow, domainIsReady, building, fastLocationData, gVoid, gLocData, colorcrsr
  11.   if not objectp(oPuppeteer) then
  12.     alert("Hey! There's no Puppeteer object")
  13.   end if
  14.   enterNewDomain(oPuppeteer, [field "LocationStubList"], "multiFrames", "foreground.DATA", "inventory.DATA")
  15.   set loadTime to the timer
  16.   REPORT2(" enterNewDomain(oPuppeteer) done at " & loadTime & " ticks")
  17.   set myMem to the freeBytes
  18.   if fastLocationData then
  19.     REPORT2("loading data from external data-files...")
  20.     set gLocData to [:]
  21.     repeat with i = 1 to count(the LocationSublists of oPuppeteer)
  22.       set roomName to getAt(the LocationSublists of oPuppeteer, i)
  23.       set roomFile to FileIO(mnew, "read", the pathName & "ROXY_" & i & ".DAT")
  24.       if objectp(roomFile) then
  25.         set timeStamp to roomFile(mReadLine)
  26.         if char 1 to 30 of timeStamp <> line 2 of field "LocationStublist.OLD" then
  27.           alert("I wouldn't use this data if I were you... the time/date stamp doesn't              match the current location stub-list in this domain...")
  28.           roomFile(mdispose)
  29.           set gLocData to gVoid
  30.           exit repeat
  31.         else
  32.           set roomString to roomFile(mReadFile)
  33.           addProp(gLocData, roomName, roomString)
  34.           roomFile(mdispose)
  35.         end if
  36.         next repeat
  37.       end if
  38.       alert("Hm, there's some problem opening this file ('ROXY_" & i & ".DAT')..")
  39.       put FileIO(mError, roomFile)
  40.       set gLocData to gVoid
  41.       exit repeat
  42.     end repeat
  43.     set timeElapsed to the timer
  44.     REPORT2(">‚Ä¢> Finished loading loc-data at " & timeElapsed & " ticks..")
  45.     if voidp(gLocData) then
  46.       put "gLocData is now <void>..."
  47.     end if
  48.     if listp(gLocData) then
  49.       repeat with subString in gLocData
  50.       end repeat
  51.     end if
  52.   else
  53.     put "loading it from domain movie's cast..."
  54.     preLoadCast(30, 820)
  55.   end if
  56.   set loadTime to the timer
  57.   REPORT2(" preloading all location-data took about " & loadTime & " ticks")
  58.   REPORT2(" it also consumed " & myMem - the freeBytes & " bytes of RAM (" & (myMem - the freeBytes) / 1024 & " K)")
  59.   put "‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢"
  60.   if not objectp(colorcrsr) and (colorcrsr <> #comingBack) then
  61.     put "‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Loading cast-cursors‚Ķ ‚Ä¢‚Ä¢‚Ä¢‚Ä¢"
  62.     preLoadCast(2501, 2738)
  63.     put "‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢ Cursors loaded ‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢‚Ä¢"
  64.   end if
  65.   if not objectp(oStoryteller) then
  66.     alert("Hey! There's no Storyteller object")
  67.   end if
  68.   enablePeekAlert()
  69.   setProp(the lsStateData of oStoryteller, #currentDomain, ["ROXY"])
  70.   set the basePalette of oPuppeteer to the number of cast "ROXY base"
  71.   REPORT2("Domain is ready = TRUE, at " & the timer & " ticks")
  72. end
  73.